/*
 * block_queue.h
 *
 *  Created on: 2010/07/25
 *      Author: terry
 */

#ifndef BLOCK_QUEUE_H_
#define BLOCK_QUEUE_H_
using namespace std;

#include <string>
#include <vector>
#include <boost/smart_ptr.hpp>

template <class T>
class block_queue
{
public:
    typedef boost::shared_ptr<T> message_type;
    block_queue();
    block_queue(int bound);
    virtual ~block_queue();
    virtual int put(message_type msg);
    virtual int put(message_type msg, unsigned long timeout);
    virtual message_type get();
    virtual message_type get(unsigned long timeout);
private:
    int bound;
    vector<message_type> elements;
};

#endif /* BLOCK_QUEUE_H_ */